/**
 * Copyright (c) 2007,中企动力华南研发中心
 * All rights reserved.
 */
package com.ce.pms.house.web;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;

import com.ce.pms.base.web.PmsBaseAction;
import com.ce.pms.common.util.BeanJsonUtil;
import com.ce.pms.house.service.IManageAreaService;
import com.ce.pms.house.vo.CompanyVO;
import com.sitechasia.webx.core.annotation.Read;

/**
 * 功能描述：物业公司ACTION
 * @author 罗军林 创建日期：2008-7-16
 */
public class CompanyAction extends PmsBaseAction{
	IManageAreaService manageAreaService;
	/**
	 * 功能描述：初始化物业公司修改页面<br>
	 * <br>
	 * Create author:罗军林<br>
	 * Create on:2008-7-16<br>
	 * Edit author:<br>
	 * Edit on:<br>
	 * Why:<br>
	 */
	public void initCompanyEdit( @Read (key = "companyId") Long companyId){
		CompanyVO companyVO = manageAreaService.findCompanyById(companyId);
		setAttribute("companyVO", companyVO);
	}

	/**
	 * 功能描述:修改物业公司<br>
	 * @param companyVO<br>
	 * Create author:罗军林<br>
	 * Create on:2008-7-16<br>
	 * Edit author:<br>
	 * Edit on:<br>
	 * Why:<br>
	 * @throws InvocationTargetException
	 * @throws IllegalAccessException
	 * @throws Throwable
	 */
	public void editCompany( @Read CompanyVO companyVO ) throws Exception{
		companyVO.setCreator(this.getUserId());
		companyVO=manageAreaService.editCompany(companyVO);
		renderText( BeanJsonUtil.BeanToJsonStr(companyVO));

	}

	/**
	 * @return the manageAreaService
	 */
	public IManageAreaService getManageAreaService() {
		return manageAreaService;
	}

	/**
	 * @param manageAreaService the manageAreaService to set
	 */
	public void setManageAreaService(IManageAreaService manageAreaService) {
		this.manageAreaService = manageAreaService;
	}

}
